from epguide.parsers.teleman.TelemanChannelListParser import TelemanChannelListParser
import unittest

class  TelemanChannelListParserTest(unittest.TestCase):
    def setUp(self):
        self.maxDiff = None
        pass

    def tearDown(self):
        pass

    def testChannel(self):
        p = TelemanChannelListParser()
        f = open("stacje.html", "r")
        buf = f.read()
        channels = [str(c) for c in p.get_channels(buf)]
        f.close()
        expected = ["Channel(id:'13th-Street-Universal',name:'13th Street',icon_url:None)",
            "Channel(id:'4fun-TV',name:'4fun TV',icon_url:None)",
            "Channel(id:'ATM-Rozrywka',name:'ATM Rozrywka',icon_url:None)",
            "Channel(id:'AXN',name:'AXN',icon_url:None)",
            "Channel(id:'AXN-Crime',name:'AXN Crime',icon_url:None)",
            "Channel(id:'AXN-SciFi',name:'AXN Sci-Fi',icon_url:None)",
            "Channel(id:'AXN-Spin',name:'AXN Spin',icon_url:None)",
            "Channel(id:'Ale-Kino',name:'ale kino+',icon_url:None)",
            "Channel(id:'Animal-Planet',name:'Animal Planet',icon_url:None)",
            "Channel(id:'Animal-Planet-HD',name:'Animal Planet HD',icon_url:None)",
            "Channel(id:'BBC-Cbeebies',name:'BBC Cbeebies',icon_url:None)",
            "Channel(id:'BBC-Entertainment',name:'BBC Entertain.',icon_url:None)",
            "Channel(id:'BBC-HD',name:'BBC HD',icon_url:None)",
            "Channel(id:'BBC-Knowledge',name:'BBC Knowledge',icon_url:None)",
            "Channel(id:'BBC-Lifestyle',name:'BBC Lifestyle',icon_url:None)",
            "Channel(id:'Boomerang',name:'Boomerang',icon_url:None)",
            "Channel(id:'CBS-Action',name:'CBS Action',icon_url:None)",
            "Channel(id:'CBS-Drama',name:'CBS Drama',icon_url:None)",
            "Channel(id:'CBS-Europa',name:'CBS Europa',icon_url:None)",
            "Channel(id:'CBS-Reality',name:'CBS Reality',icon_url:None)",
            "Channel(id:'CanalPlus',name:'CANAL+',icon_url:None)",
            "Channel(id:'CanalPlus-Film',name:'CANAL+ Film',icon_url:None)",
            "Channel(id:'CanalPlus-Gol',name:'CANAL+ Gol',icon_url:None)",
            "Channel(id:'CanalPlus-Sport',name:'CANAL+ Sport',icon_url:None)",
            "Channel(id:'CanalPlus-Weekend',name:'CANAL+ Weekend',icon_url:None)",
            "Channel(id:'Cartoon-Network',name:'Cartoon Network',icon_url:None)",
            "Channel(id:'Cinemax',name:'Cinemax',icon_url:None)",
            "Channel(id:'Cinemax2',name:'Cinemax 2',icon_url:None)",
            "Channel(id:'Comedy-Central',name:'Comedy Central',icon_url:None)",
            "Channel(id:'Comedy-Central-Family',name:'Comedy Central Fam.',icon_url:None)",
            "Channel(id:'Crime-Investigation-Network',name:'Investigation',icon_url:None)",
            "Channel(id:'Discovery-Channel',name:'Discovery Channel',icon_url:None)",
            "Channel(id:'Discovery-HD-Showcase',name:'Discovery HD Show.',icon_url:None)",
            "Channel(id:'Discovery-Historia',name:'Discovery Historia',icon_url:None)",
            "Channel(id:'Discovery-Science',name:'Discovery Science',icon_url:None)",
            "Channel(id:'Discovery-World',name:'Discovery World',icon_url:None)",
            "Channel(id:'Disney-Channel',name:'Disney Channel',icon_url:None)",
            "Channel(id:'Disney-Junior',name:'Disney Junior',icon_url:None)",
            "Channel(id:'Disney-XD',name:'Disney XD',icon_url:None)",
            "Channel(id:'Domo',name:'Domo+',icon_url:None)",
            "Channel(id:'ESPN-Classic',name:'ESPN',icon_url:None)",
            "Channel(id:'Edusat',name:'Edusat',icon_url:None)",
            "Channel(id:'Eska-TV',name:'Eska TV',icon_url:None)",
            "Channel(id:'Eurosport',name:'Eurosport',icon_url:None)",
            "Channel(id:'Eurosport-2',name:'Eurosport 2',icon_url:None)",
            "Channel(id:'Extreme',name:'Extreme',icon_url:None)",
            "Channel(id:'FOX',name:'FOX',icon_url:None)",
            "Channel(id:'FightKlub',name:'FightKlub',icon_url:None)",
            "Channel(id:'Filmbox',name:'FilmBox',icon_url:None)",
            "Channel(id:'Filmbox-Extra',name:'FilmBox Extra',icon_url:None)",
            "Channel(id:'Filmbox-Family',name:'FilmBox Family',icon_url:None)",
            "Channel(id:'Filmbox-HD',name:'FilmBox HD',icon_url:None)",
            "Channel(id:'Foxlife',name:'Fox Life',icon_url:None)",
            "Channel(id:'HBO',name:'HBO',icon_url:None)",
            "Channel(id:'HBO-Comedy',name:'HBO Comedy',icon_url:None)",
            "Channel(id:'HBO2',name:'HBO 2',icon_url:None)",
            "Channel(id:'History',name:'HISTORY',icon_url:None)",
            "Channel(id:'History-HD',name:'HISTORY HD',icon_url:None)",
            "Channel(id:'ID',name:'ID',icon_url:None)",
            "Channel(id:'Jim-Jam',name:'Jim Jam',icon_url:None)",
            "Channel(id:'Kino-Polska',name:'Kino Polska',icon_url:None)",
            "Channel(id:'Kuchnia-TV',name:'Kuchnia+',icon_url:None)",
            "Channel(id:'MGM-HD',name:'MGM HD',icon_url:None)",
            "Channel(id:'MTV-Polska',name:'MTV Polska',icon_url:None)",
            "Channel(id:'Mezzo',name:'Mezzo',icon_url:None)",
            "Channel(id:'MiniMini',name:'MiniMini+',icon_url:None)",
            "Channel(id:'Nat-Geo-Wild',name:'Nat Geo Wild',icon_url:None)",
            "Channel(id:'National-Geographic',name:'National Geo.',icon_url:None)",
            "Channel(id:'Nickelodeon',name:'Nickelodeon',icon_url:None)",
            "Channel(id:'Nickelodeon-HD',name:'Nickelodeon HD',icon_url:None)",
            "Channel(id:'Orange-Sport',name:'Orange Sport',icon_url:None)",
            "Channel(id:'Planete',name:'PLANETE+',icon_url:None)",
            "Channel(id:'Polonia-1',name:'Polonia 1',icon_url:None)",
            "Channel(id:'Polsat',name:'Polsat',icon_url:None)",
            "Channel(id:'Polsat-2',name:'Polsat 2',icon_url:None)",
            "Channel(id:'Polsat-Cafe',name:'Polsat Cafe',icon_url:None)",
            "Channel(id:'Polsat-Film',name:'Polsat Film',icon_url:None)",
            "Channel(id:'Polsat-News',name:'Polsat News',icon_url:None)",
            "Channel(id:'Polsat-Play',name:'Polsat Play',icon_url:None)",
            "Channel(id:'Polsat-Sport',name:'Polsat Sport',icon_url:None)",
            "Channel(id:'Polsat-Sport-Extra',name:'Polsat Sport Extra',icon_url:None)",
            "Channel(id:'Polsat-Sport-News',name:'Polsat Sport News',icon_url:None)",
            "Channel(id:'Puls',name:'TV Puls',icon_url:None)",
            "Channel(id:'Puls-2',name:'TV Puls 2',icon_url:None)",
            "Channel(id:'Religia-TV',name:'Religia.tv',icon_url:None)",
            "Channel(id:'SciFi-Channel',name:'Sci-Fi Channel',icon_url:None)",
            "Channel(id:'SportKlub',name:'SportKlub',icon_url:None)",
            "Channel(id:'Sundance-Channel-HD',name:'Sundance Channel HD',icon_url:None)",
            "Channel(id:'Superstacja',name:'Superstacja',icon_url:None)",
            "Channel(id:'TCM',name:'TCM',icon_url:None)",
            "Channel(id:'TLC',name:'TLC',icon_url:None)",
            "Channel(id:'TTV',name:'TTV',icon_url:None)",
            "Channel(id:'TV-Trwam',name:'TV Trwam',icon_url:None)",
            "Channel(id:'TV1000',name:'TV 1000',icon_url:None)",
            "Channel(id:'TV4',name:'TV 4',icon_url:None)",
            "Channel(id:'TV5-Monde',name:'TV5MONDE',icon_url:None)",
            "Channel(id:'TV6',name:'TV 6',icon_url:None)",
            "Channel(id:'TVN',name:'TVN',icon_url:None)",
            "Channel(id:'TVN-CNBC',name:'TVN CNBC',icon_url:None)",
            "Channel(id:'TVN-Siedem',name:'TVN 7',icon_url:None)",
            "Channel(id:'TVN-Style',name:'TVN Style',icon_url:None)",
            "Channel(id:'TVN-Turbo',name:'TVN Turbo',icon_url:None)",
            "Channel(id:'TVN24',name:'TVN 24',icon_url:None)",
            "Channel(id:'TVP-1',name:'TVP 1',icon_url:None)",
            "Channel(id:'TVP-2',name:'TVP 2',icon_url:None)",
            "Channel(id:'TVP-HD',name:'TVP HD',icon_url:None)",
            "Channel(id:'TVP-Historia',name:'TVP Historia',icon_url:None)",
            "Channel(id:'TVP-Info',name:'TVP Info',icon_url:None)",
            "Channel(id:'TVP-Kultura',name:'TVP Kultura',icon_url:None)",
            "Channel(id:'TVP-Polonia',name:'TVP Polonia',icon_url:None)",
            "Channel(id:'TVP-Seriale',name:'TVP Seriale',icon_url:None)",
            "Channel(id:'TVP-Sport',name:'TVP Sport',icon_url:None)",
            "Channel(id:'TVS',name:'TVS',icon_url:None)",
            "Channel(id:'Tele-5',name:'Tele 5',icon_url:None)",
            "Channel(id:'Travel-Channel',name:'Travel',icon_url:None)",
            "Channel(id:'Universal-Channel',name:'Universal Channel',icon_url:None)",
            "Channel(id:'VIVA-Polska',name:'VIVA Polska',icon_url:None)",
            "Channel(id:'Viacom-Blink',name:'Viacom Blink',icon_url:None)",
            "Channel(id:'Viasat-Explorer',name:'Viasat Explorer',icon_url:None)",
            "Channel(id:'Viasat-History',name:'Viasat History',icon_url:None)",
            "Channel(id:'Water-Planet',name:'Water Planet',icon_url:None)",
            "Channel(id:'Wojna-i-Pokoj',name:'Wojna i Pok\xc4\x82\xc5\x82j HD',icon_url:None)",
            "Channel(id:'nPremium-HD',name:'nPremium HD',icon_url:None)",
            "Channel(id:'nPremium2-HD',name:'nPremium2 HD',icon_url:None)",
            "Channel(id:'nPremium3-HD',name:'nPremium3 HD',icon_url:None)",
            "Channel(id:'nPremium4-HD',name:'nPremium4 HD',icon_url:None)",
            "Channel(id:'nSport',name:'nSport',icon_url:None)",
            "Channel(id:'teleTOON-plus',name:'teleTOON+',icon_url:None)"]
        self.assertEqual(channels, expected)



if __name__ == '__main__':
    unittest.main()

